{*
  Object Pascal simple control clipboard manipulation routines
  @Author  Maciej Zagozda (1998-2008)
  @Licence Microsoft Reciprocal License (Ms-RL)
  @Website http://www.codeplex.com/intelitechdelphirtns/
  @Version 2008/04/20 Added documentation support
}
unit ControlRoutines;

interface

uses
  Classes,
  ComCtrls,
  Dialogs,
  Forms,
  Messages,
  SysUtils,
  Windows;

function ListItemCaption( itemA: TListItem ): AnsiString;
function TreeItemCaption( itemA: TTreeNode ): AnsiString;
function ListSubItemCaption( itemA: TListItem; intgIndex: Byte ): AnsiString;

implementation

function ListItemCaption( itemA: TListItem ): AnsiString;
begin
  if itemA = nil then
  begin
    Result := '';
    Exit
  end
  else
  begin
    Result := ItemA.Caption;
  end;//if
end;

//_____________________________________________________________________________

function TreeItemCaption( itemA: TTreeNode ): AnsiString;
begin
  if itemA = nil then
  begin
    Result := '';
    Exit
  end
  else
  begin
    Result := ItemA.Text;
  end;//if
end;

//_____________________________________________________________________________

function ListSubItemCaption( itemA: TListItem; intgIndex: Byte ): AnsiString;
begin
  if itemA = nil then
  begin
    Result := '';
    Exit
  end
  else
  begin
    try
      Result := ItemA.SubItems[intgIndex];
    except
      Result := '';
    end;//try
  end;//if

end;

end.
